package ldh.im.web.constant;

/**
 * Created by ldh on 2019/11/6.
 */
public enum LoginType {
    ValidateCodeLogin("login1", "validateCodeLogin"),
    mobileCodeLogin("login2", "mobileCodeLogin"),
    ;

    private String name;
    private String url;

    private LoginType(String name, String url) {
        this.name = name;
        this.url = url;
    }

    public static LoginType getLoginTypeFromName(String name) {
        for(LoginType loginType : LoginType.values()) {
            if (loginType.getName().equals(name)) {
                return loginType;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
